<template>
  <div>
      <div style="width:60%;margin:0 auto">
         <el-table
            :data="userList"
            style="width:100%">

            <el-table-column
              prop="name"
              label="用户名"
              width="180">
            </el-table-column>

            <el-table-column
              prop="pwd"
              label="密码"
              width="180">
            </el-table-column>

            <el-table-column
              prop="facePath"
              label="头像">
              <template slot-scope="scope">
                <div class="block">
                <el-image style="width: 80px; height: 80px" :src="path+scope.row.facePath"></el-image>
                 
              </div>      
              </template>
            </el-table-column>

            <el-table-column label="操作">
            <template slot-scope="">
              <el-button
                size="mini"
                >编辑</el-button>
              <el-button
                size="mini"
                type="danger"
                >删除</el-button>
            </template>
    </el-table-column>
    </el-table>

    <div class="block">
            <el-pagination
            @current-change="pageClick"
            :current-page.sync="curr"
            :page-size="5"
            layout="prev, pager, next, jumper"
            :total="pageObj.total">
            </el-pagination>
        </div>
      
      </div>
  </div>
</template>

<script>
export default {

  data(){
    return{
        userList:{},
        path:"http://localhost:8080/upload/",
        curr:1,
        pageObj:{}
    }
  },
  methods:{
    pageClick(val){
      this.curr = val;
      this.findAllUser(this.curr);
    },
    aaa(ss){
        alert(this.src);
    },
    async findAllUser(){
      var token = this.$cookies.get("token");
          var obj = await this.ajax.getSubmit("/project/users",{pageNO:this.curr},token);        
          this.userList = obj.data;
          this.pageObj = obj;
    }
  }
  ,
  created(){
    // console.log(1);
    this.findAllUser();
  }

}
</script>

<style>

</style>